Skip to content

[stable33] Fix handling of "enableScripting" data attribute#1398

Open
backportbot[bot] wants to merge 3 commits intostable33from
backport/1396/stable33
Open

[stable33] Fix handling of "enableScripting" data attribute#1398
backportbot[bot] wants to merge 3 commits intostable33from
backport/1396/stable33

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot bot commented Mar 25, 2026

Backport of #1396

In PHP, a boolean is converted to a string as either "1" or "" rather
than to "true" or "false". Moreover, the value of the data attribute is
always returned as a string in JavaScript, so it never matched a strict
comparison against a boolean value.

It would be possible to fix this by comparing against "1" in Javascript.
However, for clarity (and given that semantically an existing data
attribute would be considered a boolean true if present, even if empty),
now the "enableScripting" data attribute is explicitly set to either
"true" or "false" and the comparison in JavaScript is done against a
string "true".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the backport/1396/stable33 branch from 0104e36 to 08d2fb5 Compare March 30, 2026 13:23
@danxuliu
Copy link
Copy Markdown
Member

/compile /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@danxuliu danxuliu marked this pull request as ready for review March 30, 2026 13:28
Copy link
Copy Markdown
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants